import request from '@/api/request'

import { devicesApis } from './devices_apis'
import type { CommonRes } from '@/api/user/types.ts'
import type { AxiosResponse } from 'axios'


export const devicesApi = {
  ListDevicePage(data: any) {
    return request({
      url: devicesApis.ListDevicesPage,
      method: 'post',
      data: data
    })
  },
  addDevice(data: any) {
    return request({
      url: devicesApis.addDevice,
      method: 'post',
      data: data
    })
  },
  deleteDevice(data: any) {
    return request({
      url: devicesApis.deleteDevice,
      method: 'post',
      data: data
    })
  },
  getDevice(data: any) {
    return request({
      url: devicesApis.getDevice,
      method: 'post',
      data: data
    })
  },
  executeCommand(data: any): Promise<CommonRes<boolean>> {
    return request({
      url: devicesApis.executeCommand,
      method: 'post',
      data: data
    })
  },
  getDeviceMessageLog(data: any)  {
    return request({
      url: devicesApis.ListMessageLog,
      method: 'post',
      data: data
    })
  }
}
